/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sunsite.interceptor;

import javax.servlet.http.HttpServletRequest;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import sunsite.tools.Naming;

/**
 *
 * @author Ruby
 */
public class AuthorityInterceptor implements MethodInterceptor{

    public Object invoke(MethodInvocation arg0) throws Throwable {
//        HttpServletRequest request = null;
//        ActionMapping acm = null;
//        for(Object item : arg0.getArguments())
//        {
//        if(item instanceof HttpServletRequest)
//        request = (HttpServletRequest)item;
//        }
//        if(request!=null&&request.getSession().getAttribute(Naming.UserSession)!=null)
//            return arg0.proceed();
//        else
            System.out.print("过滤ing");
//        new Exception("gg").printStackTrace();
            return arg0.proceed();
//        throw new UnsupportedOperationException("Not supported yet.");
    }

}
